python how to save a Seaborn plot into a file

159

python how to save a Seaborn plot into a file -

# Basic syntax:
plt.savefig("output.png")

# Example usage:
plt.figure()
plt.plot(range(5))
plt.savefig("output.png", dpi=300)

# Note, savefig comes from matplotlib.pyplot and plt is an 
# 	abbreviation for this, e.g. import matplotlib.pyplot as plt

how to save a png seaborn pandas -

sns.distplot(df['mpg'])
plt.savefig('saving-a-high-resolution-seaborn-plot.png', dpi=300)

Comments

Submit
0 Comments